package com.love.cloud.admin.notify.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.love.cloud.admin.api.vo.UserVO;
import com.love.cloud.admin.notify.dto.NotifyReplyChildDto;
import com.love.cloud.common.mybatis.entity.SimpleBaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @author hongdongqu
 */
@Data
@Entity
@Table(name = "notify_reply")
@TableName("notify_reply")
@EqualsAndHashCode(callSuper = false)
@org.hibernate.annotations.Table(appliesTo = "notify_reply",comment="通知公告回复表")
public class NotifyReply extends SimpleBaseEntity {

    @ApiModelProperty(value = "文章id")
    @Column(columnDefinition = "bigint(20) COMMENT '文章id'")
    private Long articleId;

    @ApiModelProperty(value = "评论人id")
    @Column(columnDefinition = "bigint(20) COMMENT '评论人id'")
    private Long userId;

    @ApiModelProperty(value = "回复楼层数，从第一层开始")
    @Column(columnDefinition = "int COMMENT '回复楼层数，从第一层开始'")
    private Integer storeyNum;

    @ApiModelProperty(value = "回复的用户，可以为空")
    @Column(columnDefinition = "bigint(20) COMMENT '回复的用户，可以为空'")
    private Long replyUserId;

    @ApiModelProperty(value = "楼层中的评论层数")
    @Column(columnDefinition = "int COMMENT '楼层中的评论层数'")
    private Integer childStoreyNum;

    @ApiModelProperty(value = "评论回复数")
    @Column(columnDefinition = "int COMMENT '评论回复数'")
    private Integer replyNum;

    @ApiModelProperty(value = "回复内容")
    @Column(columnDefinition = "VARCHAR(255) COMMENT '回复内容'")
    private String replyContent;

    @ApiModelProperty(value = "备注")
    @Column(columnDefinition = "VARCHAR(255) COMMENT '备注'")
    private String remarks;

    /**
     * 评论回复情况
     */
    @TableField(exist = false)
    @Transient
    private List<NotifyReplyChildDto> replyChildList;
    /**
     * 用户信息
     */
    @TableField(exist = false)
    @Transient
    private UserVO userVO;
}
